package com.qfedu.food.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qfedu.food.dao.TFtypeDao;
import com.qfedu.food.dto.TFoodDto;
import com.qfedu.food.pojo.TFood;
import com.qfedu.food.pojo.TFtype;
import com.qfedu.food.service.intf.TFtypeService;
import com.qfedu.food.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TFtypeServiceImpl implements TFtypeService {
    @Autowired(required = false)
    private TFtypeDao dao;

    @Override
    public R selectTFtypeAll() {
        return R.ok(dao.selectTFtypeAll());
    }

    @Override
    public PageInfo<TFoodDto> selectAll(int pageNum, int pageSize, long id) {
        PageHelper.startPage(pageNum, pageSize);
        List<TFoodDto> typeId = dao.selectAll(id);
        PageInfo<TFoodDto> pageInfo = new PageInfo<>(typeId);
        System.out.println(typeId);
        System.out.println(pageInfo);
        return pageInfo;
    }


}
